package com.iflytek.sbd.demo.fanxing;

/**
 * @program: sbd
 * @description:
 * @author: 陈英俊
 * @create: 2022-01-11 10:08
 */

interface  Info<T>{
    public  T  getVar();
}


public class InfoImpl<T>  implements Info<T> {

    private  T  var;

    public InfoImpl(T var) {
        this.var = var;
    }

    public void setVar(T var) {
        this.var = var;
    }

    @Override
    public T getVar() {
        return var;
    }

    public static void main(String[] args) {

        Info<String> i = null;        // 声明接口对象
        i = new InfoImpl<String>("汤姆") ;  // 通过子类实例化对象
        System.out.println("内容：" + i.getVar()) ;
    }
}
